Intravenous drug use is a major vector of HIV transmission. Contingency management, a behavioral treatment in which participants earn reinforcers for drug abstinence, has been shown to reduce the use of illicit drugs and to be an effective treatment of drug dependence. We assessed whether contingency management also reduces HIV-risk behaviors. Participants were methadone-maintained opiate- and cocaine-using outpatients (n = 116) randomly assigned to prize-based contingency management (the reinforcers were the opportunity to draw for prizes) or to a control group. The noncontingent control group received prize draws matched to the experimental group, but independent of their drug use. Both groups received methadone and individual counseling throughout treatment. Participants completed the HIV-Risk Taking Behaviour Scale (HRBS) in written questionnaire form every two weeks during the study. A mediation analysis was conducted to determine whether during-treatment abstinence from opiates and cocaine mediated the effect of contingency management on HRBS scores. The results showed that HIV risk behaviors, as measured by HRBS scores, differed significantly by treatment group over time, with HRBS scores decreasing over time in the contingency management group to a greater extent than in the noncontingent control group. Participants in the contingency management group also had significantly lower rates of simultaneous cocaine/opiate-positive urine specimens than those in the noncontingent control group during contingency management treatment. The relationship between treatment condition and HRBS scores was mediated by during-treatment abstinence. Contingency management targeted toward cocaine and heroin use produces significant reductions in injection-related drug-taking behaviors associated with heightened risk for getting or transmitting HIV.